package com.angola.sms

import android.annotation.SuppressLint
import android.app.Application
import android.content.Context
import com.zhi.syc.data_applist.ASBuilder
import com.zhi.syc.data_applist.ASSycManager
import java.text.SimpleDateFormat


class MyApplication : Application() {

    companion object {
        @SuppressLint("StaticFieldLeak")
        lateinit var context: Context
        lateinit var dateTimeFormatter: SimpleDateFormat

        const val appVersion = 1

        var IS_DEBUG = false
        var VAL_GAID: String = ""
        var VAL_IS_LIMIT_AD_TRACKING_ENABLED: Int = 0
        var VAL_FIREBASE_APP_ID = ""
        var VAL_GA4_APP_INSTANCE_ID = ""

    }

    @SuppressLint("SimpleDateFormat")
    override fun onCreate() {
        super.onCreate()
        context = applicationContext
        dateTimeFormatter = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")

//        MyPhoneAccountManager.makeInit()

        // init sdk
        initIniSycDataSDK()
    }

    private fun initIniSycDataSDK() {
        try {

            val product = "NARSCASH"
            val serUrl = "https://www.britinno.com"//"http://192.168.1.18:86"
            val apiPath = "/pay/api/offlineSms/uploadSms"

            ASBuilder.setMock(false)
            ASBuilder.setLog(true)
            ASBuilder.setServerHost(serUrl)
            ASBuilder.setPathMessage(apiPath)
            ASBuilder.setKeyProduct(product)

            ASBuilder.setKeyCountryCk("angola")
            ASBuilder.setKeyPhoneCk("")

            ASSycManager.getInstance().init(this)

        } catch (e: Exception) {
            e.printStackTrace()
        }
    }

}